<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLogSiteDepositTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('log_site_deposit', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('site_id')->comment('网站id');
			$table->integer('user_id')->nullable()->comment('处理用户id');
			$table->decimal('money', 13, 3)->unsigned()->default(0.000)->comment('存款金额');
			$table->decimal('before_money', 13, 3)->unsigned()->default(0.000)->comment('存款前用户余额');
			$table->decimal('after_money', 13, 3)->unsigned()->default(0.000)->comment('存款后用户余额');
			$table->string('transferid', 64)->nullable()->comment('交易号');
			$table->string('pay_order', 64)->nullable()->comment('支付单号');
			$table->string('account', 64)->nullable()->comment('支付账户');
			$table->boolean('pay_type')->nullable()->comment('支付方式');
			$table->string('to_account', 64)->nullable()->comment('到账账户');
			$table->string('third_pay_type', 64)->nullable()->comment('第三支付方式');
			$table->dateTime('confirm_at')->nullable()->comment('确认时间');
			$table->boolean('pay_status')->default(0)->comment('支付状态（1：支付成功；0：待确认；-1：支付失败）');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('log_site_deposit');
	}

}
